using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class CTPhieuChuyenKhoManagement
	{
	
		public ResultObj SaveNewCTPhieuChuyenKho(CTPhieuChuyenKho ctphieuchuyenkho)
        		{
			ResultObj result = new ResultObj();
			ctphieuchuyenkho.Id = -1;
			CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
			result = ctphieuchuyenkhoDAO.SaveCTPhieuChuyenKho(ctphieuchuyenkho);
			
			return result;
		}
		
		public ResultObj UpdateCTPhieuChuyenKho(CTPhieuChuyenKho ctphieuchuyenkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
			result = ctphieuchuyenkhoDAO.SaveCTPhieuChuyenKho(ctphieuchuyenkho);
			
			return result;
		}
		
		public ResultObj DeleteCTPhieuChuyenKho(CTPhieuChuyenKho ctphieuchuyenkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
			result = ctphieuchuyenkhoDAO.DeleteCTPhieuChuyenKho(ctphieuchuyenkho);
			
			return result;
		}
		
		public ResultObj GetAllCTPhieuChuyenKho( )
        		{
			ResultObj result = new ResultObj();
			CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
			result = ctphieuchuyenkhoDAO.GetAllCTPhieuChuyenKho();
			
			return result;
		}
		
		public ResultObj GetCTPhieuChuyenKhoById(CTPhieuChuyenKho ctphieuchuyenkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
			result = ctphieuchuyenkhoDAO.GetAllCTPhieuChuyenKhoByID(ctphieuchuyenkho);
			
			return result;
		}

        public ResultObj GetTongHopChuyenKho()
        {
            ResultObj result = new ResultObj();
            CTPhieuChuyenKhoDAO ctphieuchuyenkhoDAO = new CTPhieuChuyenKhoDAO();
            result = ctphieuchuyenkhoDAO.GetTongHopChuyenKho();

            return result;
        }
	}
}
